home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / src / gripes.cc < prev    next >
C/C++ Source or Header  |  1997-03-07  |  4KB  |  170 lines

  1. /*
  2.  
  3. Copyright (C) 1996 John W. Eaton
  4.  
  5. This file is part of Octave.
  6.  
  7. Octave is free software; you can redistribute it and/or modify it
  8. under the terms of the GNU General Public License as published by the
  9. Free Software Foundation; either version 2, or (at your option) any
  10. later version.
  11.  
  12. Octave is distributed in the hope that it will be useful, but WITHOUT
  13. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  14. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  15. for more details.
  16.  
  17. You should have received a copy of the GNU General Public License
  18. along with Octave; see the file COPYING.  If not, write to the Free
  19. Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  20.  
  21. */
  22.  
  23. #ifdef HAVE_CONFIG_H
  24. #include <config.h>
  25. #endif
  26.  
  27. #include "error.h"
  28. #include "gripes.h"
  29. #include "ov.h"
  30.  
  31. void
  32. gripe_not_supported (const char *fcn)
  33. {
  34.   error ("%s: not supported on this system", fcn);
  35. }
  36.  
  37. void
  38. gripe_string_invalid (void)
  39. {
  40.   error ("string constant used in invalid context");
  41. }
  42.  
  43. void
  44. gripe_range_invalid (void)
  45. {
  46.   error ("range constant used in invalid context");
  47. }
  48.  
  49. void
  50. gripe_nonconformant (void)
  51. {
  52.   error ("nonconformant matrices");
  53. }
  54.  
  55. void
  56. gripe_nonconformant (int r1, int c1, int r2, int c2)
  57. {
  58.   error ("nonconformant matrices (op1 is %dx%d, op2 is %dx%d)",
  59.      r1, c1, r2, c2);
  60. }
  61.  
  62. void
  63. gripe_empty_arg (const char *name, int is_error)
  64. {
  65.   if (is_error)
  66.     error ("%s: empty matrix is invalid as an argument", name);
  67.   else
  68.     warning ("%s: argument is empty matrix", name);
  69. }
  70.  
  71. void
  72. gripe_square_matrix_required (const char *name)
  73. {
  74.   error ("%s: argument must be a square matrix", name);
  75. }
  76.  
  77. void
  78. gripe_user_supplied_eval (const char *name)
  79. {
  80.   error ("%s: evaluation of user-supplied function failed", name);
  81. }
  82.  
  83. void
  84. gripe_user_returned_invalid (const char *name)
  85. {
  86.   error ("%s: user-supplied function returned invalid value", name);
  87. }
  88.  
  89. void
  90. gripe_invalid_conversion (const string& from, const string& to)
  91. {
  92.   error ("invalid conversion from %s to %s", from.c_str (), to.c_str ());
  93. }
  94.  
  95. void
  96. gripe_invalid_value_specified (const char *name)
  97. {
  98.   warning ("invalid value specified for `%s'", name);
  99. }
  100.  
  101. void
  102. gripe_2_or_3_dim_plot (void)
  103. {
  104.   error ("plot: can only plot in 2 or 3 dimensions");
  105. }
  106.  
  107. void
  108. gripe_unrecognized_float_fmt (void)
  109. {
  110.   error ("unrecognized floating point format requested");
  111. }
  112.  
  113. void
  114. gripe_unrecognized_data_fmt (const char *warn_for)
  115. {
  116.   error ("%s: unrecognized data format requested", warn_for);
  117. }
  118.  
  119. void
  120. gripe_data_conversion (const char *from, const char *to)
  121. {
  122.   error ("unable to convert from %s to %s format", from, to);
  123. }
  124.  
  125. void
  126. gripe_wrong_type_arg (const char *name, const string& s)
  127. {
  128.   error ("%s: wrong type argument `%s'", name, s.c_str ());
  129. }
  130.  
  131. void
  132. gripe_wrong_type_arg (const char *name, const octave_value& tc)
  133. {
  134.   string type = tc.type_name ();
  135.   error ("%s: wrong type argument `%s'", name, type.c_str ());
  136. }
  137.  
  138. void
  139. gripe_wrong_type_arg_for_unary_op (const octave_value& op)
  140. {
  141.   string type = op.type_name ();
  142.   error ("invalid operand `%s' for unary operator", type.c_str ());
  143. }
  144.  
  145. void
  146. gripe_wrong_type_arg_for_binary_op (const octave_value& op)
  147. {
  148.   string type = op.type_name ();
  149.   error ("invalid operand `%s' for binary operator", type.c_str ());
  150. }
  151.  
  152. void
  153. gripe_implicit_conversion (const char *from, const char *to)
  154. {
  155.   warning ("implicit conversion from %s to %s", from, to);
  156. }
  157.  
  158. void
  159. gripe_divide_by_zero (void)
  160. {
  161.   if (Vwarn_divide_by_zero)
  162.     warning ("division by zero");
  163. }
  164.  
  165. /*
  166. ;;; Local Variables: ***
  167. ;;; mode: C++ ***
  168. ;;; End: ***
  169. */
  170.